#!/bin/bash

dir=$(dirname $0)
cd $dir

k=0
for img in $(\ls -1 *.png)
do
  images[$k]=$img
  k=$(($k+1))
done

n=$k
k=0

while [ $k -lt $n ]
do
  echo "$k: ${images[$k]}"
  k=$(($k+1))
done

echo -n "Enter image number: "
read n
image=${images[$n]}

echo -n "Clockwise (1) ? "
read clockwise

./demo $image $clockwise

